﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jbe.Composite.Extensions;
using System.Reflection;

namespace Jbe.TestSuite.Infrastructure.Interface.Documents
{
    public abstract class Document : Model
    {
        private static readonly PropertyInfo FileNameProperty = TypeManager.GetProperty<Document>(x => x.FileName);
        private static readonly PropertyInfo IsDirtyProperty = TypeManager.GetProperty<Document>(x => x.IsDirty);


        private string fileName;
        private bool isDirty;


        public string FileName
        {
            get { return fileName; }
            set
            {
                if (fileName != value)
                {
                    fileName = value;
                    RaisePropertyChanged(FileNameProperty);
                }
            }
        }

        public bool IsDirty
        {
            get { return isDirty; }
            set
            {
                if (isDirty != value)
                {
                    isDirty = value;
                    RaisePropertyChanged(IsDirtyProperty);
                }
            }
        }
    }
}
